package com.yipinhouse.reception.client;

import com.yipinhouse.common.result.Result;
import com.yipinhouse.house.client.result.*;
import com.yipinhouse.reception.client.param.EsSearchEstateWebParam;
import com.yipinhouse.reception.client.param.PagePremisesWebParam;
import com.yipinhouse.reception.client.param.ResoldApartmentEsSearchWebParam;
import com.yipinhouse.reception.client.param.SearchResoldHouseWebParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "houseWebClient", name = "reception", path = "reception")
public interface HouseWebQueryClient {

    /**
     * 预定房源
     * @param id
     * @return
     */
    @PutMapping("/orderHouse")
    Result orderHouse(@RequestParam("id") Integer id);

    /**
     * 购买房源
     * @param houseId
     * @return
     */
    @PutMapping("/saleHouse")
    Result saleHouse(@RequestParam("houseId") Integer houseId);

    /**
     * es综合查询
     * @param resoldApartmentEsSearchParam
     * @return
     */
    @GetMapping("resoldApartmentEsSearch")
    Result<List<ResoldApartmentListResultInfo>> resoldApartmentEsSearch(ResoldApartmentEsSearchWebParam resoldApartmentEsSearchParam);

    /**
     * 根据id查询房屋详细信息
     * @param houseId
     * @return
     */
    @GetMapping("getResoldApartmentInfo")
    Result<ResoldApartmentInfoResult> getResoldApartmentInfo(Integer houseId);

    /**
     * 搜索房源
     * @param param
     * @return
     */
    @GetMapping("/searchResoldHouse")
    Result<PageResoldHouseInfo> searchResoldHouse(SearchResoldHouseWebParam param);

    /**
     * 预定房源
     * @param houseId
     * @return
     */
    @GetMapping("/checkHouseStatus")
    Result<String> checkHouseStatus(@RequestParam("houseId") Integer houseId);

    /**
     * 查询出租房信息
     * @param houseId
     * @return
     */
    @GetMapping("/getResoldHouseInfo")
    Result<ResoldHousingResult> getResoldHouseInfo(@RequestParam("houseId") Integer houseId);

    /**
     * 查询楼盘信息
     * @param param
     * @return
     */
    @PostMapping ("/searchPremises")
    Result<PagePremisesResultInfo> searchPremises(@RequestBody PagePremisesWebParam param);

    /**
     * 根据id查询楼盘具体信息
     * @param id
     * @return
     */
    @GetMapping("/searchOnePremises")
    Result<ThisPremisesResultInfo>  searchPremisesById(@RequestParam("id") Integer id);

    /**
     * 展示楼盘户型
     * @param buildingId
     * @return
     */
    @GetMapping("/searchApartment")
    Result<List<ApartmentResultInfo>> searchApartment(@RequestParam("id") Integer buildingId);

    /**
     * Es条件查询小区
     *
     * @param param
     * @return
     */
    @GetMapping("esSearchEstate")
    public Result<PageEstateResultInfo> esSearchEstate(EsSearchEstateWebParam param);

    /**
     * 根据Id查询小区详情
     * @param estateId
     * @return
     */
    @GetMapping("checkEstate")
    Result<EstateResultInfo> checkEstate(@RequestParam("estateId") Integer estateId);
}
